package com.jy.func;

import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
 
 
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class MainActivity extends ActionBarActivity implements OnClickListener{
 

	private ActionBar actionBar;

	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
 
        actionBar = getSupportActionBar();  
        actionBar.setDisplayHomeAsUpEnabled(true); 
 
		Button btn=(Button)findViewById(R.id.buttom1);
		btn.setOnClickListener(this);
		Button btn2=(Button)findViewById(R.id.buttom2);
		btn2.setOnClickListener(this);
		Button btn3=(Button)findViewById(R.id.buttom3);
		btn3.setOnClickListener(this);
		Button btn4=(Button)findViewById(R.id.buttom4);
		btn4.setOnClickListener(this);
		
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.

        switch (item.getItemId()) {
    	case android.R.id.home:
			finish();
			return true;
    	case  R.id.action_settings:
    		 return true;
        }
        return super.onOptionsItemSelected(item);
    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.buttom1:
		{
            Intent intent = new Intent();
            intent.setClass(MainActivity.this, ScorllActivity.class);
            startActivity(intent);
		}
			break;
		case R.id.buttom2:
		{
            Intent intent = new Intent();
            intent.setClass(MainActivity.this, JazzyActivity.class);
            startActivity(intent);
		}
			break;
		case R.id.buttom3:
		{
            Intent intent = new Intent();
            intent.setClass(MainActivity.this, ParallaxActivity.class);
            startActivity(intent);
		}
			break;
		case R.id.buttom4:
		{
            Intent intent = new Intent();
            intent.setClass(MainActivity.this, ImageSliderActivity.class);
            startActivity(intent);
		}
			break;
		default:
			break;
		}
		
	}
    


 
}
